const express = require('express')

const app = express()

app.set('secret', 'y1y2y3x4x5x6')

// middleware
app.use(require('cors')())
app.use(express.json())
app.use('/', express.static(__dirname + '/web'))
app.use('/admin', express.static(__dirname + '/admin'))
app.use('/uploads', express.static(__dirname + '/uploads'))

// 引用路由
require('./routes/admin')(app)
require('./routes/web')(app)
require('./plugins/db')(app)



app.listen(8848, () => {
    console.log("serve start listen 8848")
})
